package com.tbit.main.pojo;

import lombok.Data;

import java.util.Objects;

/**
 * 设备最后状态和借出信息
 *
 * @author Leon
 * 2019年11月11日 上午10:44:20
 */
@Data
public class MachineStatusFault {
    /**
     * 设备id
     */
    private Integer machineId;
    /**
     * 用户码
     */
    private String userCode;
    /**
     * 设备编号
     */
    private String machineNO;
    /**
     * 定位时间
     */
    private String posDt;
    /**
     * 电池时间
     */
    private String batDt;
    /**
     * 经度
     */
    private Double lon;
    /**
     * 纬度
     */
    private Double lat;
    /**
     * 校准经度
     */
    private Double lonC;
    /**
     * 校准纬度
     */
    private Double latC;
    /**
     * 电量百分比
     */
    private Integer socPercent;
    /**
     * 剩余续航里程
     */
    private Integer surplusMileage;
    /**
     * 故障类型
     */
    private String faultType;
    /**
     * 故障来源
     */
    private Integer faultFrom;
    /**
     * 电池方案id
     */
    private Integer batteryModelId;
    /**
     * 车辆类型
     */
    private Integer machineType;
    /**
     * 电池管理
     */
    private String batteryNO;
    /**
     * 设备状态
     */
    private Integer state;

    /**
     * 库存状态
     */
    private Boolean stock;
    /**
     * 扣押状态
     */
    private Boolean detention;

    @Override
    public boolean equals(Object o) {
        if (this == o) {
            return true;
        }
        if (o == null || getClass() != o.getClass()) {
            return false;
        }
        MachineStatusFault that = (MachineStatusFault) o;
        return Objects.equals(machineId, that.machineId) &&
                Objects.equals(userCode, that.userCode) &&
                Objects.equals(machineNO, that.machineNO) &&
                Objects.equals(posDt, that.posDt) &&
                Objects.equals(batDt, that.batDt) &&
                Objects.equals(lon, that.lon) &&
                Objects.equals(lat, that.lat) &&
                Objects.equals(lonC, that.lonC) &&
                Objects.equals(latC, that.latC) &&
                Objects.equals(socPercent, that.socPercent) &&
                Objects.equals(surplusMileage, that.surplusMileage) &&
                Objects.equals(faultType, that.faultType) &&
                Objects.equals(faultFrom, that.faultFrom);
    }

    @Override
    public int hashCode() {
        return Objects.hash(machineId, userCode, machineNO, posDt, batDt, lon, lat, lonC, latC, socPercent, surplusMileage, faultType, faultFrom);
    }
}
